<tagLib name="html" />
<include file="Public:headerNew" />
<load href="__PUBLIC__/Js/jqueryUI/jquery-ui-1.8.16.custom.min.js" />
<load href="__PUBLIC__/Css/jqueryUI/jquery-ui-1.8.21.custom.css" />
<load href="__PUBLIC__/Js/Jquery/jquery.form.js" />
<load href='__PUBLIC__/Js/listtolist.js'/>
		<style type="text/css">
			/*demo page css*/

			.demoHeaders { margin-top: 2em; }
			#dialog_link {padding: .4em 1em .4em 0px;text-decoration: none;position: relative;}
		</style>
        <form method='post' id="form1" name="form1" action="__URL__/insertItem"  enctype="multipart/form-data">
<div class="titleone"><h1 class="fLeft">缴费编号[{$com.resid}]<input name="resid" type="hidden" value="[{$com.resid}" /><input name="meterid" type="hidden" value="[{$com.meterid}" /><input name="bizsid" type="hidden" value="[{$com.bizSid}" /><input name="bizid" type="hidden" value="[{$com.id}" /><input name="pay_anum" id="pay_anum" type="hidden" value="0" /><input name="pay_anum1" id="pay_anum1" type="hidden" value="0" /></h1><a href="__URL__"><div class="returnimg"></div></a></div>
<div id="result" class="result none"></div>
<!-- ui-dialog -->
		<div id="dialog" title="缴费确认">
			<p>
            <table width="500" border="0" cellspacing="3" cellpadding="3" style="font-size:18px;">
  <tr>
    <td width="97" height="35" align="right" style="border-left:#F00 8px solid;padding-left:4px;">应收款项：</td>
    <td width="178" align="left" style="font-size:24px;color:#525252;" id="pay_last">&nbsp;</td>
    <td width="65">&nbsp;</td>
    <td width="121">&nbsp;</td>
  </tr>
  <tr>
    <td height="35" align="right">实收款项：</td>
    <td align="left"><input id="pay_num" name="pay_num" type="text" class="inputSID" style="width:120px;"/></td>
    <td>找零：</td>
    <td style="font-size:24px;color:#F00;" id="other_pay">0.00</td>
  </tr>
  <tr>
    <td height="35"></td>
    <td>&nbsp;</td>
    <td id="other_pay">&nbsp;</td>
    </tr>
  <tr>
    <td height="35">&nbsp;</td>
    <td align="left">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
          </table>

            </p>
		</div>

		<script type="text/javascript">
			$(function(){
				var wSize = getPageSize();
				reWindows(); 
                
                 //输入数字
                $("#pay_num").keyup(function(){
                	var a = $("#pay_num").val();
                    var b = Number($("#pay_last").html());
               		if(($.isNumeric(a))&&(a>=b)){   
                    	$("#other_pay").html(accSubtr(Number(a),b));
                    
                    }else{
						$("#other_pay").html("0.00");
					}
  						
				});
                
                
                
				initPnum();
					$(window).resize(function(){  
						reWindows(); 
					}); 
					
	       		$('#form1,#from2').ajaxForm({
						type: 'POST',
									
						beforeSubmit:  checkForm,  // pre-submit callback
						
						success:       complete,  // post-submit callback
						
						dataType: 'json'
				
				});
					
		
		        
				function checkForm(){

							if( '' == $.trim($('#pay_anum').val())){
											
									$('#result').html('名字不能为空').show();
							
											return false;
							
							}
							


							

								
							//可以在此添加其它判断
		
						}
							
				function complete(data){
						
							if (data.status==1){
						
										$('#result').html(data.info).show();
						
										// 更新列表
						
										data = data.data;
						
									}else{
						
										$('#result').html(data.info).show();
						
									}
			 } 
			
			// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					width: 800,
					modal: true,
					buttons: {
						" 缴 费 ": function() { 
								$('#pay_anum1').val(Number($('#pay').html()));
								$('#pay_anum').val($('#pay_last').html());
								$('#monyy').val($('#p_mon').html());
								$("#form1").submit();
								//$(this).dialog("close"); 
						} 
						
					}
				});
				
				// Dialog Link
				$('#dialog_link').click(function(){
					//累计收费分位全进位
					
					
                	$('#pay_last').html(accAdd(Number($('#pay').html()),0.04).toFixed(1));
                    $('#pay_anum1').val(Number($('#pay').html()));
					$('#pay_anum').val($('#pay_last').html());
					$($("#pay_num")).trigger("focus"); 
					$('#dialog').dialog('open');
					return false;
				});
								//hover states on the static widgets
				
				function reWindows(){
					$(".thumbr").attr("width",wSize[0]-300-268);
					$(".newTb").attr("width",wSize[0]-300-180);
					$(".pt_left").attr("width",wSize[0]-290);
					
				}

                

			});
            
			function submitForm() { 
									// inside event callbacks 'this' is the DOM element so we first 
									// wrap it in a jQuery object and then invoke ajaxSubmit 
						$(this).submit();
       					return false;	
								
   			};
			//选择收费项目
			function selectOption(terget){

                if($("#"+terget).is(":checked")){
                	$("#"+terget).attr("checked",true);
                 	$("#tr_"+terget).removeAttr('style');
                    $("#pay").html(accAdd(Number($("#pay").html()),Number($("#"+terget+"_pp").html())));
                   
                }else{
                	$("#checkall").removeAttr("checked");
                    $("#"+terget).removeAttr("checked");
                    
                	$("#tr_"+terget).css("display","none");
                    $("#pay").html(accSubtr(Number($("#pay").html()),Number($("#"+terget+"_pp").html())));
                }
				
			}
            //选择收费项目
			function selectAllOption(){
				var num = accAdd(Number($("#we_1").html()),Number($("#ww_1").html()));
            	if($("#checkall").is(":checked")){
                	$("#checkall").attr("checked",true);
 
                    	num= accAdd(num,Number($("#p_1").html()));

                    	num= accAdd(num,Number($("#h_1").html()));

                    $("#cp").attr("checked",true);
                    $("#ch").attr("checked",true);
                                        
                    $("#tr_cp").removeAttr('style');
                    $("#tr_ch").removeAttr('style');
                    
                    $("#pay").html(num);
                    
                 }else{
                 	$("#checkall").removeAttr("checked");
                    $("#cp").removeAttr("checked");
                    $("#ch").removeAttr("checked");
                    $("#tr_cp").css("display","none");
                    $("#tr_ch").css("display","none");
                    $("#pay").html(accAdd(Number($("#we_1").html()),Number($("#ww_1").html())));
                 }
				
			}
			//计算物业费用
			function initPnum(){
            	var nu=accMul(accMul(Number($("#p_znum").html()),Number($("#p_price").html())),Number($("#p_mon").html()));
                
				
                var nu1=nu.toFixed(2);
				//实际金额
                $("#p_anum").val(nu);

                 $("#cp_pp").html(nu1);
                 $("#ch_pp").html(accMul(Number($("#h_znum").html()),Number($("#h_price").html())).toFixed(2));
                 $("#h_anum").val(accMul(Number($("#h_znum").html()),Number($("#h_price").html())));
                 $("#p_1").html($("#cp_pp").html());
				 $("#h_1").html($("#ch_pp").html());
            
            }
			

			
			
			
</script>

<div id="main" class="main full" >
<div class="metroTitle">{$com.name} [{$com.bizSid}]<input type="hidden" name="bizid" value="{$com.id}" /><input type="hidden" name="resid" value="{$com.resid}" /></div><div class="showMon tCenter" style="margin-top:-30px;"><div class="monthshw">{$mon}</div><div style="margin-left:50px;margin-top:14px;">{$year}</div></div>
<!--右侧开始-->
<div class="pt_right">
  <div style="margin-top:55px;border-top:#3399ff 2px solid;">
  <a href="#"  id="dialog_link"><img  src="__PUBLIC__/images/icons/pay.png" style="margin:6px;"/></a>
  </div>
  <div>
  <p style="border-left:#3399ff 6px solid; padding:4px; font-size:18px; font-weight:500;">
  应收款项：<span id="pay" style="padding:4px; font-size:18px; font-weight:500;">{$com['enum1']+$com['wnum1']+$com['wwnum']}</span>
  	<table width="260" border="0" cellpadding="6" cellspacing="3" style="margin-left:8px;">
  <tr>
    <td width="60" align="left">水电费:</td>
    <td width="134" id="we_1">{$com['enum1']+$com['wnum1']}</td>
  </tr>
  <tr>
    <td width="60" align="left">污水处理费:</td>
    <td id="ww_1">{$com.wwnum}</td>
  </tr>
  <tr id="tr_cp" style="display:none;">
    <td width="60" align="left">物业费:</td>
    <td id="p_1">0.0</td>
  </tr>
  <tr id="tr_ch"  style="display:none;">
    <td  width="60" align="left">采暖费:</td>
    <td id="h_1">0.0</td>
  </tr>
    </table>

  </p>
  </div>
</div>
<!--右侧结束-->


<!--左侧主体-->
<div class="pt_left">
<ul id="pn_list" class="pn_list">
<li>
<div class="thumb">
<img src="__PUBLIC__/images/icons/weter_icon.png"/>
</div>
<div class="thumbr">

<table class="newTb" width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:14px;color:#525252; margin:2px 2px; padding:2px 2px;">
  <tr height="35" style="background-color:#f6f6f6">
    <th width="20%" align="left">表标识</th>
    <th width="15%" align="left">上月数</th>
    <th width="15%" align="left">本月数</th>
    <th width="15%" align="left">表量</th>
    <th width="15%" align="left">单价</th>
    <th width="20%" align="left">总金额</th>
  </tr>
  <volist name="listw" id="vo">
  <tr height="35">
    <td align="left" height="35" style="border-bottom:#ececec 1px solid;">{$vo.meterid}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo.meterNum1}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo.meterNum2}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo['meterNum2']-$vo['meterNum1']}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo.meterprice}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo['meterNum2']*$vo['meterprice']-$vo['meterNum1']*$vo['meterprice']}</td>
  </tr>
 </volist>
</table>
</div>
<span>
总表量：{$com.awnum}     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;合计金额：{$com.wnum1}</span>
</li>
<li>
<div class="thumb">
<img src="__PUBLIC__/images/icons/e_icon.png"/>
</div>
<div class="thumbr">
<table class="newTb" width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:14px;color:#525252; margin:2px 2px; padding:4px 4px;">
  <tr height="35" style="background-color:#f6f6f6">
    <th width="20%" align="left">表标识</th>
    <th width="15%" align="left">上月数</th>
    <th width="15%" align="left">本月数</th>
    <th width="15%" align="left">表量</th>
    <th width="15%" align="left">单价</th>
    <th width="20%" align="left">总金额</th>
  </tr>
  <volist name="liste" id="vo">
  <tr height="35">
    <td align="left" height="35" style="border-bottom:#ececec 1px solid;">{$vo.meterid}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo.meterNum1}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo.meterNum2}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo['meterNum2']-$vo['meterNum1']}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo.meterprice}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$vo['meterNum2']*$vo['meterprice']-$vo['meterNum1']*$vo['meterprice']}</td>
  </tr>
 </volist>
</table>
</div>
<span>
总表量：{$com.aenum}     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;合计金额：{$com.enum1}</span>
</li>
<li>
<div class="thumb">
<img src="__PUBLIC__/images/icons/other_icon.png"/>
</div>

<div class="thumbr">
<table class="newTb" width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:14px;color:#525252; margin:2px 2px; padding:4px 4px;">
  <tr height="35" style="background-color:#f6f6f6">
    <th width="8%" align="left">
      <input name="checkall" type="checkbox" id="checkall" onClick="selectAllOption();"/>
    选择</th>
    <th width="15%" align="left">名称</th>
    <th width="15%" align="left">月数/年</th>
    <th width="15%" align="left">表量/面积</th>
    <th width="15%" align="left">单价</th>
    <th width="20%" align="left">总金额</th>
    <th width="20%" align="left">到期月</th>
    </tr>

  <tr height="35">
    <td align="left" style="border-bottom:#ececec 1px solid;"></td>
    <td align="left" height="35" style="border-bottom:#ececec 1px solid;">污水费</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">1</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$com.awnum}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;">{$com.ww_price}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="wwp">{$com.wwnum}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="wwp">&nbsp;</td>
    </tr>
  <tr height="35">
    <td align="left" style="border-bottom:#ececec 1px solid;"><input type="checkbox" name="cp" id="cp" value="1" onclick="selectOption('cp')" /></td>
    <td align="left" height="35" style="border-bottom:#ececec 1px solid;">物业费<input id="monyy" name="monyy" type="hidden" vaule="{$p_mon}"/>
      <input id="p_anum" name="p_anum2" type="hidden" vaule="0"/>
   </td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="p_mon">{$p_mon}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="p_znum">{$com.znum}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="p_price">{$com.p_price}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="cp_pp">&nbsp;</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="pdate">{$com.p_update}</td>
    </tr>
    <tr height="35">
      <td align="left" style="border-bottom:#ececec 1px solid;"><input type="checkbox" name="ch" value="1" id="ch" onclick="selectOption('ch')" /></td>
    <td align="left" height="35" style="border-bottom:#ececec 1px solid;">采暖费
      <input id="h_anum" name="p_anum" type="hidden" vaule="0"/>
    </td>
    <td align="left" style="border-bottom:#ececec 1px solid;">4</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="h_znum">{$com.znum2}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="h_price">{$com.h_price}</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="ch_pp">&nbsp;</td>
    <td align="left" style="border-bottom:#ececec 1px solid;" id="hdate">{$com.h_update}</td>
    </tr>
</table>
</div>
<span>合计金额：</span>
</li>
</ul>
</div>
<!--左侧主体结束-->
</div></form>







		


